<?php
$obj = new Categories();
$categories = $obj->select();
?>
<!-- start sidebar two -->
<div id="sidebar2" class="sidebar">
    <ul>
        <li>
            <h2>Categories</h2>
            <ul>
                <?php foreach ($categories as $category):?>
                <li><a href="#"><?php echo $category['name']; ?></a></li>
                <?php                endforeach;?>
            </ul>
        </li>			
    </ul>
</div>
<!-- end sidebar two -->